<template>
  <div class="wrap">
    <header>
      <span @click="go()">&lt;</span>
      <p>直播</p>
    </header>
    <main>
      <dl v-for="(item,index) in list" :key="index">
        <dt>
          <video
            src="https://mp4.vjshi.com/2021-06-23/6e457e96362f4eb38f5e46004f29be19.mp4"
            width="375"
            height="240"
            controls
          ></video>
        </dt>
        <dd>
          <h3>{{item.introduce}}</h3>
          <div>
            <img src="../../img/bo.png" alt />
            <span>{{item.date}}</span>
          </div>
        </dd>
        <p @click="toHuiFang(item)">精彩回放</p>
      </dl>
      <!-- <div class="p2">
        <van-icon name="plus" @click="add()" />
      </div> -->
    </main>
  </div>
</template>

<script>
import axios from "../../utils/request";
export default {
  data() {
    return {
      list: []
    };
  },
  created() {
    this.getList();
  },
  methods: {
    go() {
      this.$router.go(-1);
    },
    getList() {
      axios({
        url: "/api/getList",
        method: "post"
      }).then(res => {
        // console.log(res);
        this.list = res.data.data;
      });
    },

    toHuiFang(item) {
      this.$router.push(`/huifang/${item.id}`);
    },

    // add() {
    //   this.$router.push("/createbo");
    // }
  }
};
</script>

<style lang="scss" scoped>
.wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
header {
  width: 100%;
  height: 50px;
  display: flex;
  line-height: 50px;
  align-items: center;
  background: rgb(56, 121, 240);
  padding: 15px;
  color: #fff;
  p {
    padding-left: 38%;
  }
}
main {
  flex: 1;
  overflow-y: scroll;
  dl {
    position: relative;
    dt img {
      width: 100%;
      height: 200px;
    }
    dd {
      margin: 10px;

      h3 {
        font-size: 18px;
        padding: 5px 0;
      }
      div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 5px;
        span {
          color: #999;
        }
      }
    }
    p {
      position: absolute;
      top: 25px;
      left: 5px;
      width: 80px;
      height: 30px;
      line-height: 30px;
      text-align: center;
      background: rgb(56, 121, 240);
      border-radius: 20px;
    }
  }
  // .p2 {
  //   width: 50px;
  //   height: 50px;
  //   line-height: 50px;
  //   background: rgb(56, 121, 240);
  //   border-radius: 50%;
  //   text-align: center;
  //   position: absolute;
  //   right: 30px;
  //   bottom: 30px;
  //   color: #fff;
  // }
}
</style>